/** FASSIT (Forms of Selective Attention in Intelligent Transportation Systems)
 * Computational Creativity and Digital Media
 * Cognitive and Media Systems Group
 * Centre for Informatics and Systems of the University of Coimbra (CISUC)
 *
 * Copyright (c) 2010-2013 University of Coimbra, Portugal
 * All rights reserved.
 */
package masterAgent.DBmanager;

import agent.Context.Goal;

/**
 * ------------------------------------------------------------------------ This
 * class is used to store the subcategories correspondent to the agent's goals
 * ------------------------------------------------------------------------
 * 
 * @author Hernani Costa
 * @version 0.1 date: 20/11/2012
 */
public class QueryGoal {
	private String queryCoffee, queryDinner, queryLunch, queryParty,
			queryShopping;
	Goal goals;

	/**
	 * ------------------------------------------------------------------------
	 * Constructor class
	 * ------------------------------------------------------------------------
	 */
	public QueryGoal() {
		this.queryCoffee = "w.catID = 4 OR w.subcatID = 110 OR w.subcatID = 123 OR w.subcatID = 1 OR w.subcatID = 80 OR w.subcatID = 101 OR w.subcatID = 171";
		this.queryLunch = "w.catID = 7 AND w.subcatID <> 110 AND w.subcatID <> 123 AND w.subcatID <> 1 AND w.subcatID <> 80 AND w.subcatID <> 180 AND w.subcatID <> 908 AND w.subcatID <> 913 AND w.subcatID <> 909 AND w.subcatID <> 912 AND w.subcatID <> 361 AND w.subcatID <> 171";
		this.queryDinner = "w.catID = 7 AND w.subcatID <> 110 AND w.subcatID <> 123 AND w.subcatID <> 1 AND w.subcatID <> 80 AND w.subcatID <> 180 AND w.subcatID <> 908 AND w.subcatID <> 913 AND w.subcatID <> 909 AND w.subcatID <> 912 AND w.subcatID <> 361 AND w.subcatID <> 171";
		this.queryParty = "w.catID = 4";
		this.queryShopping = "w.catID = 6";
		goals = new Goal();
	}

	public String getQueryCoffee() {
		return queryCoffee;
	}

	public String getQueryDinner() {
		return queryDinner;
	}

	public String getQueryLunch() {
		return queryLunch;
	}

	public String getQueryParty() {
		return queryParty;
	}

	public String getQueryShopping() {
		return queryShopping;
	}

	public String getQuery(String goal) {

		if (goal.equals(goals.getCoffee())) {
			return getQueryCoffee();
		} else if (goal.equals(goals.getDinner())
				|| goal.equals(goals.getLunch()))
			return getQueryDinner();
		else if (goal.equals(goals.getParty()))
			return getQueryParty();
		else if (goal.equals(goals.getShopping()))
			return getQueryShopping();
		// If the Goal is not well defined, returns null
		return null;
	}
}
